import { getAction, deleteAction, putAction, postAction, httpAction, downFile } from '@/api/manage'

const serviceName = '/sjsk-flow-service'
const personServiceName = '/sjsk-person-service'
const alarmServiceName = '/sjsk-alarm-service'
const clinicmanageServiceName = '/sjsk-clinicmanage-service'
const crowmanageServiceName = '/sjsk-crowmanage-service'
/*-----------流程-----------*/
//获取流程配置列表
const getProcessList = (params) => getAction(`${serviceName}/processConfig/getProcessList`, params)
//新增流程配置信息
const addProcess = (params) => postAction(`${serviceName}/processConfig/add`, params)
//获取流程配置详情
const getDetail = (id) => getAction(`${serviceName}/processConfig/getEditDetail/${id}`)
//编辑流程配置信息
const updateProcess = (params) => putAction(`${serviceName}/processConfig/update`, params)
//停用、启用操作
const operateProcess = (params) => putAction(`${serviceName}/processConfig/operate`, params)
//删除流程配置信息
const deleteProcess = (id) => deleteAction(`${serviceName}/processConfig/delete/${id}`)

/*-----------审批-----------*/
//我的请求列表
const getMyApplyList = (params) => getAction(`${serviceName}/processApproval/getMyApplyProcessInfoList`, params)
//审批列表（通用）
const getProcessInfoList = (params) => postAction(`${serviceName}/processApproval/getProcessInfoList`, params)
//获取审批信息
const getApprovalId = (params) => getAction(`${serviceName}/processApproval/getApprovalId`, params)
//根据id获取审批详情信息
const getApprovalInfo = (id) => getAction(`${serviceName}/processApproval/getApprovalInfo/${id}`)
//查询流程详情
const getProcessDetail = (id) => getAction(`${serviceName}/processApproval/getProcessNodeList/${id}`)
//审批
const approval = (params) => putAction(`${serviceName}/processApproval/approval`, params)
//撤销申请
const cancel = (params) => putAction(`${serviceName}/processApproval/cancel`, params)
//重新申请
const restart = (params) => putAction(`${serviceName}/processApproval/restart`, params)
//待办数量
const getWaitNum = (params) => getAction(`${serviceName}/processApproval/getWaitNum`, params)
//催一下
const getUrge = (params) => getAction(`${serviceName}/processApproval/urge`, params)
//添加入组信息
const updateMstPersonInfo = (params) => postAction(`${clinicmanageServiceName}/sjsk/person/updateMstPersonInfo`, params)
//添加办公室意见
const updateCompEvaluation = (params) => postAction(`${crowmanageServiceName}/compEvaluation/updateCompEvaluation`, params)
// 解除sjsk通知书
const jcsjsktzs = (params) => postAction(`${clinicmanageServiceName}/report/jcsjsktzs`, params)

/*-----------审批详情页-基本信息-----------*/
//变更执行地详情查看
const changePlaceDetail = (id) => getAction(`${personServiceName}/apply/changePlaceDetail/${id}`)
//变更执行地联系人详情查看
const changePlaceContactsDetail = (id) => getAction(`${personServiceName}/apply/changePlaceContactsDetail/${id}`)
//省内省外异地管控详情查看
const remoteControlDetail = (id) => getAction(`${personServiceName}/apply/remoteControlDetail/${id}`)
//同城转介详情查看
const cityIntroduceDetail = (id) => getAction(`${personServiceName}/apply/cityIntroduceDetail/${id}`)
//中止详情查看
const abortDetail = (id) => getAction(`${personServiceName}/apply/abortDetail/${id}`)
//中止详情查看
const getAbortDatail = (id) => getAction(`${personServiceName}/apply/getAbortDatail/${id}`)
//社戒社康人员请假详情查看
const sjskOutLeaveDetail = (id) => getAction(`${personServiceName}/apply/sjskOutLeaveDetail/${id}`)
//省外异地管控-外省转入，转出外省申请表详情查看
const applyOutsideDetail = (id) => getAction(`${personServiceName}/apply/applyOutsideDetail/${id}`)
//省外异地管控-转出省外异常上报申请表详情查看
const abnormalReportDetail = (id) => getAction(`${personServiceName}/apply/abnormalReportDetail/${id}`)
//根据id查询社戒社康人员信息
const getSjskPersonInfo = (id) => getAction(`${personServiceName}/apply/getSjskPersonInfo/${id}`)
//根据id查询社戒社康人员信息
const getSocialPersonInfo = (id) => getAction(`${personServiceName}/apply/getSocialPersonInfo/${id}`)
//告警事件-查看详情
const taskDetails = (id) => getAction(`${alarmServiceName}/task/details/${id}`)
//告警事件-查看详情-任务模型
const taskModelDetails = (id) => getAction(`${alarmServiceName}/task/modelDetails/${id}`)
//告警事件-查看详情-目标对象
const taskUserDetails = (params) => getAction(`${alarmServiceName}/task/userDetails`, params)
//获取任务模型
const taskQueryModel = (params) => getAction(`${alarmServiceName}/task/queryModel`, params)
//查看风险等级评估详情
const viewRiskLevelEval = (params) => postAction(`${crowmanageServiceName}/riskLevelEval/viewRiskLevelEval`, params)
//风险等级评估详情-获取吸毒查获情况
const viewDrugSeizure = (params) => postAction(`${crowmanageServiceName}/riskLevelEval/drugSeizure`, params)

export {
  getProcessList,
  addProcess,
  getDetail,
  updateProcess,
  operateProcess,
  deleteProcess,
  getMyApplyList,
  getProcessInfoList,
  getApprovalId,
  getApprovalInfo,
  getProcessDetail,
  approval,
  cancel,
  restart,
  getWaitNum,
  getUrge,
  updateMstPersonInfo,
  updateCompEvaluation,
  jcsjsktzs,
  changePlaceDetail,
  changePlaceContactsDetail,
  remoteControlDetail,
  cityIntroduceDetail,
  abortDetail,
  getAbortDatail,
  sjskOutLeaveDetail,
  applyOutsideDetail,
  abnormalReportDetail,
  getSjskPersonInfo,
  getSocialPersonInfo,
  taskDetails,
  taskModelDetails,
  taskUserDetails,
  taskQueryModel,
  viewRiskLevelEval,
  viewDrugSeizure
}
